﻿<?php
class Indexs extends CI_Controller
{
	public function __construct()
	{
	   	
		parent::__construct();
		$this->load->model('word_model');
		$this->load->model('user_model');
        $this->load->helper('url_helper');
		$this->load->library('session');
		$this->load->library('encryption');
		
	}
	public function index()
	{
		$data = array();
		if(isset($_SESSION['user']))
		{
			$data['user'] = $_SESSION['user'];
			$_SESSION['id'] = $this->user_model->getID(array("user"=>$_SESSION["user"]));
			$data['flag']  = 1;
			//$_SESSION['id'] = 1;
			$this->load->view('index', $data);
			
		}
		else
		{
			$data['flag'] = 0;
			$this->load->view('index', $data);
		}
	}
    
	public function indexSecond()
	{
		$data = array();
		if(isset($_SESSION['user']))
		{
			$data['user'] = $_SESSION['user'];
			$data['flag']  = 1;
			$this->load->view('second_index', $data);
			
		}
		else
		{
			$data['flag'] = 0;
			$this->load->view('second_index', $data);
		}
	}
}